<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数组的扩展</title>

    <script>
        let arr = [
            {
                id:10086,
                name:"zhangsan",
                age:30
            },
            {
                id:10087,
                name:"lisi",
                age:30
            },
            {
                id:10088,
                name:"wangwu",
                age:30
            },

        ]

        let result = {}
        arr.forEach(ele => ele.id === 10086 ? console.log(result = ele) : console.log({}))

        let result2 = arr.find(ele => ele.id === 10086);

        console.log(result2)
    </script>
</head>
<body>



</body>
</html>